Skip to content

feat(runtime): execute canonical agent specs in deterministic dry-run - #6

Draft
ProfRandom92 wants to merge 6 commits into
mainfrom
p1/runtime-contract-integration
Draft

feat(runtime): execute canonical agent specs in deterministic dry-run#6
ProfRandom92 wants to merge 6 commits into
mainfrom
p1/runtime-contract-integration

Conversation

@ProfRandom92

@ProfRandom92 ProfRandom92 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Objective

Execute canonical agent specs in deterministic dry-run and replay validation within the Rust runtime CLI.

Security & Quality Hardening

  • Resolved case-insensitive path security check bypass for .git, .ssh, and .aws using eq_ignore_ascii_case().
  • Refactored actual_events.last() access in handle_agent_replay to use panic-safe pattern matching.
  • Wrapped line-by-line evidence file output in std::io::BufWriter with explicit flush().
  • Compiled static regex ^[a-z][a-z0-9_-]*$ using std::sync::OnceLock.

Tests & Quality Gates

  • 126 passing tests (cargo test --all-targets): 42 unit tests in src/main.rs & src/cli_p1.rs, 84 integration tests in tests/cli_smoke.rs.
  • cargo fmt --all --check: Passed cleanly.
  • cargo clippy --all-targets -- -D warnings: Passed cleanly with 0 warnings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds agent-related commands (validate-spec, dry-run, and replay) to the CLI, introducing new modules for contract definitions and agent execution logic, alongside a security check to block access to sensitive directories. The feedback highlights several critical improvements: preventing a potential panic when replaying empty evidence logs, using case-insensitive comparisons to avoid security bypasses on case-insensitive file systems, buffering file writes to improve performance, and caching compiled regular expressions using OnceLock.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/cli_p1.rs Outdated
Comment thread src/cli.rs Outdated
Comment thread src/cli_p1.rs
Comment thread src/cli_p1.rs Outdated
@ProfRandom92

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant